package com.bgs.config;


import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DirectConfig {
//     设置基本mq名称
    public static final String DIRECT_MSY_EXCHANGE_NAME = "msy.exchange";
    public static final String DIRECT_MSY_QUEUE_NAME = "msy.queue";
    public static final String DIRECT_MSY_ROUTING_KEY_NAME = "msy.key";

    @Bean
    DirectExchange directmsyExchangeName(){
        return new DirectExchange(DIRECT_MSY_EXCHANGE_NAME);
    }

    @Bean
    Queue directmsyQueue(){
        return new Queue(DIRECT_MSY_QUEUE_NAME,true);
    }
    @Bean
    Binding directMsyBindingName(){
        return BindingBuilder.bind(directmsyQueue()).to(directmsyExchangeName()).with(DIRECT_MSY_ROUTING_KEY_NAME);
    }
}
